<?php
//供其它应用调用，方便权限判断
//韦心红 2010-7-9
class AdmAction extends Action{
	//	执行应用初始化
	public function _initialize() {
		$this->assign("site_opts",$this->site);
		$adminId	=	$_SESSION['SociaxAdmin'];
		if($adminId==0 AND MODULE_NAME!='Public'){
			redirect(__ROOT__.'/index.php?app=admin&mod=Public&act=login');
		}
		
		$admin_array	=	array(9,1,8,10,11,12,56,16,19,20);
		$uid	=	intval($_SESSION['mid']);

		$isAdmin	=	Model('UserGroup')->isAdmin($uid);
		if(!$isAdmin){
			$this->error('您不是管理员！');
		}
	}
}
?>